package by.bsu.touragency.db.beans;

public class People {
	private int id;
	private int adults;
	private int children;

	public People() {
		super();
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getAdults() {
		return adults;
	}

	public boolean setAdults(int adults) {
		if (isValidNumber(adults)) {
			this.adults = adults;
			return true;
		} else
			return false;

	}

	private boolean isValidNumber(int num) {
		if (num >= 0 && num < 50)
			return true;
		else
			return false;
	}

	public int getChildren() {
		return children;
	}

	public boolean setChildren(int children) {
		if (isValidNumber(adults)) {
			this.children = children;
			return true;
		} else
			return false;
	}

}
